package com.study.elasticsearch.clientHighLevelClient;

import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class Controller {

    @Autowired
    private ServiceImpl service;
    @PostMapping(value = "/list")
    public List<Hotel> queryList(@RequestBody RequestParams requestParams){
        List<Hotel> hotels = service.queryList(requestParams);
        return hotels;
    }

    @PostMapping(value = "/index/update")
    public AcknowledgedResponse update(@RequestBody RequestParams requestParams)throws Exception{
     //   AcknowledgedResponse update = service.update();
        service.updateData();
        return null;
    }
}
